
cmake_minimum_required( VERSION 2.6 )

nane_include_thirdparty( GoogleTest )
include(${thirdparty_configs})

set( NANE_UNITTESTS_SRC 
test_filesystem.cpp
test_logsystem.cpp
test_typetraits.cpp
)

if( NANE_BUILD_SERIALIZESYSTEM )
    set( NANE_UNITTESTS_SRC ${NANE_UNITTESTS_SRC} test_serializesystem.cpp )
endif()

if( NANE_BUILD_FILEARCHIVESYSTEM )
    set( NANE_UNITTESTS_SRC ${NANE_UNITTESTS_SRC} test_filearchivesystem.cpp )
endif()

if( NANE_BUILD_SCRIPTSYSTEM )
    set( NANE_UNITTESTS_SRC ${NANE_UNITTESTS_SRC} test_scriptsystem.cpp )
endif()

if( GTEST_FOUND )
    configure_file(test.lua ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test.lua COPYONLY)
    configure_file(ziptest.zip ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ziptest.zip COPYONLY)
    add_executable( nane_unittest ${NANE_UNITTESTS_SRC} )
    target_link_libraries( nane_unittest ${nane_thirdparty_libs} nane )
endif()
